import { connect } from 'react-redux'
import Counter from '../component/counter'
import {addAction,subAction} from '../action/counterAction'


function mapStateToProps(initialState) {
	return {
		count: initialState.counter.count
	}
}

function mapDispatchToProps(dispatch) {
	return {
		onCounterAdd: () => dispatch(addAction()),
		onCounterSub: () => dispatch(subAction())
	};
}

const counterContainer = connect(
	mapStateToProps,
	mapDispatchToProps
	)(Counter);

export default counterContainer;